﻿using Microsoft.AspNetCore.Mvc;
using MiniErp.Model.Entities.AssetManagement;
using MiniErp.Model.Templates;
using MiniErp.Service.DBService.IService.IAssetManagement;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860

namespace MiniErp.App.Controllers.AssetManagement
{
    [Route("api/AssetManagement")]
    [ApiController]
    public class AssetIndex : ControllerBase
    {
        private readonly IAssetIndexService _assetIndexService;
        public AssetIndex(IAssetIndexService assetIndexService)
        {
            _assetIndexService = assetIndexService;
        }


        [Route("GetFuzzyAssetInfo")]
        [HttpPost]
        public async Task<ActionResult<MessageTemplate<List<AssetInfoEntity>>>> GetFuzzyAssetInfo(string value, int page, int num)
        {
            return await _assetIndexService.GetFuzzyAssetInfoAsync(value, page, num);
        }


    }
}
